import { createBrowserRouter } from "react-router-dom";
import App from '../App'
import { lazy } from "react";
import Error from '../pages/404'
import {
    DesktopOutlined,
    UserOutlined,
} from '@ant-design/icons';

const Home = lazy(() => import('../pages/home'))
const Me = lazy(() => import('../pages/me'))

export const homeelse = [
    {
        path: 'home',
        element: <Home />,
        title: '首页',
        icon: <DesktopOutlined />
    },
    {
        path: 'me',
        element: <Me />,
        title: '我的',
        icon: <UserOutlined />
    }
]

const routes = [
    {
        path: '/',
        element: <App />,
        children: homeelse
    },
    {
        path: '*',
        element: <Error />
    }
]
// eslint-disable-next-line react-refresh/only-export-components
export default createBrowserRouter(routes)
// export default routes